<?php
require_once('Mobile_Detect.php');
require_once('utils.php');
$detect = new Mobile_Detect();

?>
<!DOCTYPE html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title><?php echo($lang->home->title) ?></title>
    <meta name="description" content="<?php echo($lang->home->description) ?>" />
    <meta property="fb:app_id" content="<?php echo($lang->home->fbapp_id) ?>" /> 
	<meta property="og:type" content="website" /> 
	<meta property="og:title" content="<?php echo($lang->home->ogtitle) ?>" /> 
	<meta property="og:image" content="<?php echo(hostname().$lang->home->ogimage) ?>" /> 
	<meta property="og:description" content="<?php echo($lang->home->ogdescription) ?>" /> 
	<meta property="og:url" content="<?php echo(full_url()) ?>">
    
    <link rel="stylesheet" href="css/fonts/fonts.css" />
    <link rel="stylesheet" href="css/jquery.mobile.structure-1.0.1.min.css" />
    
    <link rel="stylesheet" href="css/tablet.css" />
	<!--<script src="js/libs/modernizr-2.5.3.min.js"></script>-->
    
</head>
<body>
    <div data-role="page" id="landing">
        <div data-role="content">
            <div class="ui-grid-a">
                <div class="ui-block-a">
                    <h1><a href="./"><?php echo($lang->tablet->home->h1) ?></a></h1>
                    <div class="copy">
                        <?php echo($lang->tablet->home->intro) ?>
                        <a class="domainname" href="<?php echo($lang->home->domainname) ?>"><?php echo($lang->home->domainname) ?></a>
                    </div>
                </div>
                <div class="ui-block-b">
                    <div class="tiles">
                        <?php
                        $tileArray = array(
                        	'0' => array('e', 'b', 'b', 'e', 'b'),
                        	'1' => array('e', 'm', 'm', 'e', 'b'),
                        	'2' => array('b', 'i', 'e', 'i', 'b'),
                        	'3' => array('b', 'e', 'i', 'e', 'm'),
                        	'4' => array('b', 'i', 'e', 'i', 'e'),
                        	'5' => array('b', 'b', 'm', 'm', 'm'),
                        	'6' => array('b', 'b', 'e', 'b', 'e')
                        	);
                        for ($i = 0; $i < count($tileArray); $i++) 
                        {
                        	echo('<div class="Row">');
                        	for ($j=0; $j < count($tileArray[$i]); $j++) 
                        	{
                        		switch($tileArray[$i][$j]) 
                        		{
                        			case 'e':
                        				echo ('<div class="Tile Empty"></div>');
                        				break;
                        			case 'b':
                        				echo ('<div class="Tile Blank"></div>');
                        				break;
                        			case 'm':
                        				printf('<div class="Tile Map" style="background-image:url(../img/tablet/tiles/%s%s.png);"></div>', $i, $j);
                        				break;
                        			case 'i':
                        			$append = '<div class="Tile Industry"><a href="%s" class="%s" data-role="button" data-transition="none"></a></div>';
                        			switch($i) 
                        			{
                        				case 2:
                        					if ($j == 1) 
                        						printf($append, "industry.php?industry=telcoinfo", "Telecommunications");
                                            elseif ($j == 3) 
                        						printf($append, "industry.php?industry=financialinfo", "BFS");
                        					break;

                        				case 3:
                        					if ($j == 2) 
                        						printf($append, "industry.php?industry=resourceinfo", "NaturalResources");
                        					break;
                        				
                        				case 4:
                        					if ($j == 1) 
                        						printf($append, "industry.php?industry=governmentinfo", "Government");
                        					elseif ($j == 3) 
                        						printf($append, "industry.php?industry=utilitiesinfo", "Utilities");
                        					break;
                        			}
                        		}
                        	}
                        	echo('</div>');
                        }
                        ?>
                    </div>
                </div>
            </div>
        </div>
        <div data-theme="" data-role="footer" data-position="fixed">
            <div class="divider"></div>     
            <div class="social">
            
                <!-- AddThis Button BEGIN -->
                <div class="addthis_toolbox addthis_default_style addthis_20x20_style">
                <a class="addthis_button_email" addthis:title="<?php echo($lang->sharing->facebook->title) ?>" addthis:description="<?php echo($lang->sharing->facebook->description) ?>" addthis:url="http://discovermapsforbusiness.com" addthis:email_template="discovermapsforbusiness"><img src="img/tablet/email.png" /></a>
                <a class="addthis_button_twitter" addthis:title="<?php echo($lang->sharing->twitter) ?>" addthis:url="http://discovermapsforbusiness.com"><img src="img/tablet/twitter.png" /></a>
                </div>
                <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e5affd91537e09b"></script>
                <!-- AddThis Button END -->
                <div class="plusone">
                    <div class="g-plusone" data-size="standard" data-href="http://discovermapsforbusiness.com"></div>

                    <!-- Place this render call where appropriate -->
                    <script type="text/javascript">
                      (function() {
                        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                        po.src = 'https://apis.google.com/js/plusone.js';
                        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
                      })();
                    </script>
                </div>
            </div>
            <a data-role="button" data-transition="none" href="<?php $_SERVER["DOCUMENT_ROOT"] ?>">
                <img src="img/google-logo.png" alt="<?php echo($lang->home->footer->googlelogoalt) ?>" class="logo" />
            </a>
        </div>
    </div>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script>        window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>
    <script src="//www.google.com/jsapi"></script>
    <script src="js/plugins.js"></script>
    <script src="js/tablet.js"></script>
    <script src="js/libs/jquery.mobile-1.0.1.min.js"></script>
        
    <?php include_once($_SERVER["DOCUMENT_ROOT"].'/includes/ga.php') ?>
	<script src="js/analytics.js"></script>
</body>
</html>
